package com.linghang.lhonline.service.Impl;

import com.linghang.lhonline.dataobject.Reply;
import com.linghang.lhonline.repository.ReplyRepository;
import com.linghang.lhonline.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReplyServiceImpl implements ReplyService {


    private ReplyRepository replyRepository;

    @Autowired
    public ReplyServiceImpl(ReplyRepository replyRepository) {
        this.replyRepository = replyRepository;
    }

    @Override
    public Reply save(Reply reply) {
        return replyRepository.save(reply);
    }

    @Override
    public void delete(Reply reply) {
        replyRepository.delete(reply);
    }

    @Override
    public List<Reply> findByCommentId(Integer commentId) {
        return replyRepository.findByCommentId(commentId);
    }

    @Override
    public Reply findByReplyId(Integer replyId) {
        return replyRepository.findByReplyId(replyId);
    }

    @Override
    public List<Reply> findByTargetId(Integer targetId) {
        return replyRepository.findByTargetId(targetId);
    }

    @Override
    public List<Reply> findAll() {
        return replyRepository.findAll();
    }
}
